package com.link.base.base.redpacketconfig.service;

import com.link.base.base.redpacketconfig.model.RedPktCfg;
import com.link.base.base.redpacketconfig.model.RedPktGlobalCfg;
import com.link.core.basic.service.BasicService;
import com.link.core.basic.service.BasicServiceException;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: 闫有霞
 * @date: 2019-01-23
 * @comments: 红包全局设置
 */
public interface RedPktGlobalCfgService extends BasicService<RedPktGlobalCfg> {


     /**
     *@createdBy 闫有霞
     *@date 2019/1/23
     *@methods: loadGlobalCfgToRedis
     *@param:   RedPktGlobalCfg entity
     *@return:  void
     *@description: 加载全局设置数据到Redis
     **/

    public void  loadGlobalCfgToRedis(RedPktGlobalCfg entity)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2019/1/23
     * @methods: insertGlobalCfg
     * @param: RedPktGlobalCfg entity
     * @return: void
     * @description:
     **/
    @Transactional(rollbackFor = BasicServiceException.class)
    public void  insertGlobalCfg(RedPktGlobalCfg entity)throws Exception;

    /**
     *@createdBy 闫有霞
     *@date 2019/1/23
     *@methods: updateGlobalCfg
     *@param: RedPktGlobalCfg entity
     *@return: void
     *@description:
     **/
    public void updateGlobalCfg(RedPktGlobalCfg entity) throws Exception;


    /**
     * @createdBy 闫有霞
     * @date 2019/1/23
     * @methods: insertRedCfg
     * @param:  RedPktCfg entity
     * @return:
     * @description: 添加红包设置包括全局，领取，付款设置
     **/
    public void insertRedCfg(RedPktCfg entity)throws Exception;


    /**
     * @createdBy 闫有霞
     * @date 2019/1/23
     * @methods: iupdateRedCfg
     * @param:  RedPktCfg entity
     * @return:
     * @description: 更新红包设置包括全局，领取，付款设置
     **/
    public void updateRedCfg(RedPktCfg entity)throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2019/1/24
     * @methods: queryRedCfg
     * @param: RedPktCfg entity
     * @return:  RedPktCfg
     * @description: 查询红包设置对象
     **/
    public RedPktCfg queryRedCfg(RedPktCfg entity) throws Exception;

    /**
     * @createdBy 闫有霞
     * @date 2019/1/24
     * @methods:  upsertRedCfg
     * @param: RedPktCfg entity
     * @return: void
     * @description: 有记录就新建没记录就更新
     **/
    @Transactional(rollbackFor = BasicServiceException.class)
    public void  upsertRedCfg(RedPktCfg entity) throws Exception;
}
